#pragma once

#include "zen_vap_helper.h"
#include "zen_vap_node.h"
#include "zen_vap_texture.h"
#include "zen_vap_mesh.h"
#include <vector>
#include <mutex>

namespace Zen { namespace Vap {
	class Entity : public Node3d, public PartWithMatrix3d, public PartWithColor {
	public:
		Entity();
		
		void setMesh(std::shared_ptr<Mesh>);

		std::shared_ptr<Mesh> getMesh();

		void setTexture(SharedTexture texture);

		virtual void draw() override;
	protected:
		std::shared_ptr<Mesh> m_mesh;
		std::vector<Color4f> m_colors;

		SharedTexture m_texture;
	public:
		float ro = 0.01f;
		bool m_is_mesh_dirty = false;

#if ZEN_DRAW_METAL
		EntityBuffer mRBuffer;
//		UVIBufferTexture3d mRBuffer2;
#endif

	protected:
		void drawR_();
	};
	class Ground : public Node2d {
	public:
		
		virtual void draw() override;
	};
}}
